package reflect;

import java.lang.reflect.Member;
import java.lang.reflect.Method;

public class Test4 {
    public static void main(String[] args) throws Exception {
        Class c=Class.forName("reflect.Person");
        Object o = c.newInstance();
        Method[] methods = c.getMethods();
        for(Method method : methods)
        {
            boolean b=method.isAnnotationPresent(AutoRunMethod.class);
            if(b)
            {
                AutoRunMethod arm=method.getAnnotation(AutoRunMethod.class);
                int i=arm.value();
                for (int j = 0; j < i; j++) {
                    method.invoke(o);
                }
            }
        }
    }
}
